package com.stand.hardcode.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.stand.hardcode.util.RequestAttributes;
//home
public class HomeServlet extends HttpServlet{
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		if(req.getSession().getAttribute(RequestAttributes.CURRENT_USER) != null){
			
			try {
				req.getRequestDispatcher("home_loggedin.jsp").forward(req, resp);
			} catch (ServletException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}else{
			try {
				req.getRequestDispatcher("home.jsp").forward(req,resp);
			} catch (ServletException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
